package com.wxtl.service;

import org.springframework.stereotype.Service;

import com.wxtl.dao.DogDAO;
import com.wxtl.entity.Dog;
import com.wxtl.util.DataGridModel;
import com.wxtl.util.Page;

@Service
public class DogService {
	private DogDAO dogDAO;

	public void setDogDAO(DogDAO dogDAO) {
		this.dogDAO = dogDAO;
	}
	
	public Page query(DataGridModel dgm,Dog dog, int dealFlag){
		return dogDAO.query(dgm, dog, dealFlag);
	}
	
	public void deal(int[] ids,String agentsn){
		for(int i=0;i<ids.length;i++){
			Dog dog = dogDAO.getDogById(ids[i]);
			dog.setAgentsn(agentsn);
			dogDAO.update(dog);
		}
	}
}
